<template>
  <div class="not-found-container">
    <div class="content-wrapper">
      <div class="button-wrapper">
        <router-link to="/" class="round-button">返回首页</router-link>
        <button @click="goBack" class="round-button secondary">返回上一页</button>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { useRouter } from 'vue-router'

const router = useRouter()

const goBack = () => {
  if (window.history.length > 1) {
    router.go(-1)
  } else {
    router.push('/')
  }
}
</script>

<style scoped>
@import '@/styles/components/NotFound.css';
</style>